package com.monitor.search;

import com.monitor.model.Dept;
import com.monitor.pubInter.BaseSearch;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
/**
*   @author afeng
*   @Date 2025-03-17 10:50:14
*   @description DeptSearch      部门信息
*/


@Data
@ApiModel("部门信息DeptSearch")
public abstract class DeptSearch<Sub extends DeptSearch<Sub>> extends BaseSearch {
    @ApiModelProperty(value = "主键")
    private List idIn;
    @ApiModelProperty(value = "大于排序")
    private Integer sortNumGreater;
    @ApiModelProperty(value = "小于排序")
    private Integer sortNumLess;
    @ApiModelProperty(value = "是否显示 1:是:Y,0:否:N")
    private List showFlagIn;
    @ApiModelProperty(value = "是否删除 1:删除:Y,0:正常:N")
    private Integer delFlagEq=0;
    @ApiModelProperty(value = "部门名称")
    private String nameLike;
    @ApiModelProperty(value = "上级部门id")
    private String parentIdLike;

    public DeptSearch() {
        setDelFlagEq(0);
    }



    /**
    * 返回子类Sub
    * @return
    */
    public abstract Sub getSubThis();

    @Override
    public String createTimeFiled() {
        return Dept.CREATE_TIME;
    }
    @Override
    public String updateTimeFiled() {
        return Dept.UPDATE_TIME;
    }
    @Override
    public String  setDefaultField() {
        return Dept.CREATE_TIME;
    }
    @Override
    public String pkField() {
        return Dept.ID;
    }

    @Override
    public String  toString() {
        return "DeptSearch{}"+super.toString();
    }
    public Sub setIdIn(List idIn){
        this.idIn = idIn;
        setInField(Dept.ID, idIn);
        return getSubThis();
    }
    public Sub setSortNumGreater(Integer sortNumGreater){
        this.sortNumGreater = sortNumGreater;
        setGreaterField(Dept.SORT_NUM, sortNumGreater);
        return getSubThis();
    }
    public Sub setSortNumLess(Integer sortNumLess){
        this.sortNumLess = sortNumLess;
        setLessField(Dept.SORT_NUM, sortNumLess);
        return getSubThis();
    }
    public Sub setShowFlagIn(List showFlagIn){
        this.showFlagIn = showFlagIn;
        setInField(Dept.SHOW_FLAG, showFlagIn);
        return getSubThis();
    }
    public Sub setDelFlagEq(Integer delFlagEq){
        this.delFlagEq = delFlagEq;
        setEqualField(Dept.DEL_FLAG, String.valueOf(delFlagEq));
        return getSubThis();
    }
    public Sub setNameLike(String nameLike){
        this.nameLike = nameLike;
        setLikeField(Dept.NAME, nameLike);
        return getSubThis();
    }
    public Sub setParentIdLike(String parentIdLike){
        this.parentIdLike = parentIdLike;
        setLikeField(Dept.PARENT_ID, parentIdLike);
        return getSubThis();
    }
}